﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Huayuan.Manage.Common
{
    public class ViewBagObject
    {
        public UrlHelper Url { get; set; }

        public ViewBagObject()
        {
            ModelListPage = new ListPageModel();
        }

        public void SetUrl(UrlHelper helper)
        {
            
            Url = helper;
            ModelListPage.Url = Url.Action("ListData");
        }

        public class ListPageModel
        {
            public string Url = "ListData";
            public string DataType = "json";
            public string Sortname = "Id";
            public string Sortorder = "desc";
            public string Usepager = "true";
            public string Title = "";
            public int Pagesize = 15;
            public int[] Pagesizes = new int[] { 10, 15, 20, 30, 50 };
            public string Paramcontainer = ".searchbar";
        }

        public ListPageModel ModelListPage { get; set; }


        /// <summary>
        /// POSTBACK的Action路径
        /// </summary>
        public string FormAction { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public string ErrorInfo { get; set; }

        /// <summary>
        /// 提示信息自动关闭时间
        /// </summary>
        public int? ErrorInfoCloseInfoTimeOut { get; set; }

        /// <summary>
        /// 警告信息
        /// </summary>
        public string WarningInfo { get; set; }

        /// <summary>
        /// 提示信息自动关闭时间
        /// </summary>
        public int? WarningInfoCloseInfoTimeOut { get; set; }

        /// <summary>
        /// 提示信息 
        /// </summary>
        public string PromptInfo { get; set; }

        /// <summary>
        /// 提示信息自动关闭时间
        /// </summary>
        public int? PromptInfoCloseInfoTimeOut { get; set; }

        /// <summary>
        /// 回传父页面信号
        /// </summary>
        public string NotifyOpennerIntent { get; set; }



    }
}